<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>电影列表</title>
    <%- include common %>
</head>
<body>
    <%- include("head",{title:"comment",username}) %>
    <div class="container container-fluid">
        <div class="row" >
            <div class="col-md-6 col-sm-6 col-lg-6">
                <h2 class="text-danger text-center">电影详情</h2>
                <div class="thumbnail">
                    <img src="<%- result.images.large.replace(/img7/,'img3') %>" alt="" style="height:500px;width: 100%">
                    <div>
                        <h4 class="pull-right"><%- result.year %></h4>
                        <h4 class="text-danger"><%- result.title %> </h4>
                        <p class="text-success">评分：<%- result.rating.average %></p>
                        <p class="text-primary">分类：<%- result.genres %></p>
                        <p class="text-primary">导演：<%- result.directors[0].name %></p>
                        <p class="text-primary">
                            <% result.casts.forEach((item,i)=>{ %>
                                <span><%- item.name %></span>
                            <% }) %>
                        </p>
                        <p style="display: flex;justify-content: space-around;">
                            <% result.casts.forEach((item,i)=>{ %>
                                <img style="flex: 1;height: 200px;" src="<%- item.avatars.small.replace(/img7/,'img3') %>" alt="">
                            <% }) %>
                        </p>
                    </div>
            
                </div>
            </div>
            <div class="col-md-6 col-sm-6 col-lg-6">
                <h2 class="text-success text-center">电影评论</h2>

                <form action="/comment/submit?mid=<%- result.id %>"  method="POST">
                    <div class="form-group">
                        <label for="title">评论标题</label>
                        <input id="title" name="title"  type="text" class="form-control" placeholder="请输入评论标题">
                    </div>
                    <div class="form-group">
                        <label for="content">评论内容</label>
                        <textarea rows="16" id="content"  name="content" class="form-control" placeholder="请输入评论内容"></textarea>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-success">提交</button>
                        <button type="reset" class="btn btn-danger">重置</button>
                    </div>

                    <div class="thumbnail" style="margin-top: 20px;">
                        <h4 for="title">评论社区</h4>
                        <% data.forEach((item,i)=>{ %>
                            <div style="min-height: 50px; margin: 20px;">
                                <p><%- item.time %></p> 
                                <p style="margin-left: 20px;"><%- item.author %>:<%- item.content %></p>
                                <p class="pull-right"> 回复 </p>
                            </div>   
                        <% }) %>
                        <button onclick="location.href='/comment/message?mid=<%-mid%>'" class="btn btn-warning" type="button">更多评论</button>
                    </div>
                </form>
            </div>
        </div>

    <%- include foot %>

</body>
</html>